package entities;
// default package
// Generated 2014-07-29 18:57:10 by Hibernate Tools 3.4.0.CR1

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

@Entity
@Table(name="T_RESERVATION")
public class Reservation implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private int reservationId;
	private Customer customer;
	private Date repairDate;
	private String description;
	private Car car;
	private Status status;

	public Reservation() {
	}

	public Reservation(Customer customer, Date repairDate) {
		this.customer = customer;
		this.repairDate = repairDate;
	}
	
	public Reservation(Customer customer, Date repairDate, Car car) {
		this.customer = customer;
		this.repairDate = repairDate;
		this.car = car;
	}
	
	public Reservation(Customer customer, Date repairDate, String description) {
		this.customer = customer;
		this.repairDate = repairDate;
		this.description = description;
	}
	
	public Reservation(Customer customer, Date repairDate, String description, Car car) {
		this.customer = customer;
		this.repairDate = repairDate;
		this.description = description;
		this.car = car;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="RESERVATION_ID",unique = true, nullable = false)
	public int getReservationId() {
		return reservationId;
	}

	public void setReservationId(int reservationId) {
		this.reservationId = reservationId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "RESERVATION_CUSTOMER_ID", nullable = false)
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Column(name="REPAIR_DATE", nullable=false)
        @Temporal(javax.persistence.TemporalType.DATE)
	public Date getRepairDate() {
		return repairDate;
	}

	public void setRepairDate(Date repairDate) {
		this.repairDate = repairDate;
	}

	@Column(name="DESCRIPTION", nullable=false)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "RESERVATION_CAR_ID", nullable = false)
	public Car getCar() {
		return car;
	}

	public void setCar(Car car) {
		this.car = car;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "RESERVATION_STATUS_ID", nullable = false)
	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	

	
	

}
